package com.cs.service;

import com.cs.dao.StudentDao;
import com.cs.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StudentService {
    @Autowired
    private StudentDao studentDao;

    public List<Student> selectAll(){
        return studentDao.selectAll();
    }

    public Student SelectById(int id){
        return studentDao.SelectById(id);
    }

    public List<Student> selectName(String studentName){
        return studentDao.selectName(studentName);
    }

    public Boolean deleteById(int id){
        return studentDao.deleteById(id)>0;
    }

    public Boolean insertStudent(Student student){
        return studentDao.insertStudent(student)>0;
    }

    public Boolean updateStudent(Student student){
        return studentDao.updateStudent(student)>0;
    }
}
